#ifndef  LED_I2C_H
#define  LED_I2C_H

#include <linux/types.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <linux/rtc.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>
#include <iostream>

#define I2C_DEFAULT_TIMEOUT		1
#define I2C_DEFAULT_RETRY		3
#define SLAVER_ADDR                  0X50
#define REG_ADDR                     0X51
#define DATA_TRAN                    2222  
using namespace std;

typedef unsigned char           uchar;    
typedef unsigned short          ushort;   
typedef unsigned int            uint;   

class LED_I2C{
 public:
	LED_I2C( uint device_addr );
	~LED_I2C( );
	int  LED_I2C_open( const char* dev);
	int  LED_I2C_set ( uint timeout, uint retry );
	int  LED_I2C_send( struct i2c_rdwr_ioctl_data *data );
  int  LED_I2C_writedata(uint rdwr_addr, uint val );
	int  LED_I2C_readdata (uint rdwr_addr, uchar *buffer );
//	void LED_I2C_close(int fd);

 private:
	uchar device_addr;
  static int fd; 
};
		
#endif
